import { ElMessage } from "element-plus";

/**
 * 点击复制内容
 */
export function copy(data: any) {
  let oInput = document.createElement("input");
  oInput.value = data;
  document.body.appendChild(oInput);
  oInput.select(); // 选择对象;
  document.execCommand("Copy"); // 执行浏览器复制命令
  ElMessage({
    message: "复制成功",
    type: "success",
  });
  oInput.remove();
}
